package com.amado.course39match;

import java.math.BigInteger;

/**
 * 用于操作大整型数据 加减乘除幂，理论没有数据长度大小限制
 * 普通的Intger,Long有最大值限制
 */
public class BigIntegerTest {
    public static void main(String[] args) {
        long a = Long.MAX_VALUE + 1;
        System.out.println(Long.MAX_VALUE + " + 1 = " + a);
        BigInteger bigInteger = new BigInteger(String.valueOf(Long.MAX_VALUE));
        bigInteger = bigInteger.add(new BigInteger("1"));
        System.out.println(Long.MAX_VALUE + "+ 1 = " + bigInteger);
    }
}
